<template>
  <div class="tag-group">
    <el-tag
      :type="tag.type || types[~~(Math.random() * 5)]"
      closable
      v-for="tag in tagList"
      :key="tag.key"
      @close="$emit('update:tagList', tag)"
      >{{ tag.label }}:{{ tag.value }}</el-tag
    >
  </div>
</template>

<script>
export default {
  name: "TagGroup",
  props: {
    tagList: {
      type: Array, // [{label: '最高价', key: 'maxPrice'， value: 999, type:'error'},{}]
    },
  },
  data() {
    return {
      types: ["success", "danger", "warning", "info", "primary"],
    };
  },
};
</script>

<style scoped></style>
